1. Field of the Invention
The present invention relates to a magnetic sensor device for converting a magnetic field intensity into an electric signal, and more particularly to a magnetic sensor device to be employed as a sensor for detecting an open/close state used in a flip phone, a notebook computer, or the like, or a sensor for detecting a rotational position of a motor.
2. Description of the Related Art
A magnetic sensor device has been employed as a sensor for detecting the open/close state used in a flip phone, a notebook computer, or the like, or a sensor for detecting a rotational position of a motor (for example, refer to Japanese Patent Application Laid-open No. 2001-337147). A circuit diagram of the magnetic sensor device is illustrated in FIG. 7.
In the magnetic sensor device, a magnetoelectric conversion element (for example, Hall element) outputs a voltage proportional to a magnetic field intensity or a magnetic flux density, an amplifier amplifies the output voltage, and a comparator judges the voltage (outputs a binary signal of an H signal or an L signal). The output voltage of the magnetoelectric conversion element is minute, and is easily affected by an offset voltage (element offset voltage) of the magnetoelectric conversion element, an offset voltage (input offset voltage) of the amplifier or the comparator, or noise within the conversion device, which leads to a problem. The element offset voltage is mainly developed by a stress exerted on the magnetoelectric conversion element by a package. The input offset voltage is mainly developed by a characteristic variation of an element that configures an input circuit of the amplifier. The noise is mainly generated by a flicker noise of a monolithic transistor that configures a circuit, or a thermal noise of the monolithic transistor or a resistive element.
In order to reduce an influence of the above-mentioned offset voltage of the magnetoelectric conversion element or the amplifier, the magnetic sensor device illustrated in FIG. 7 is configured as follows. The magnetic sensor device illustrated in FIG. 7 is configured to include a Hall element 1, a switching circuit 2 that switches between a first detection state and a second detection state of the Hall element 1, a differential amplifier 3 that amplifies a voltage difference (V1−V2) of two output terminals of the switching circuit 2, a capacitor C1 having one end connected to one output terminal of the differential amplifier 3, a switch S1 connected between the other output terminal of the differential amplifier 3 and the other end of the capacitor C1, and a comparator 4. In the first detection state, a supply voltage is input from terminals A and C, and a detection voltage is output from terminals B and D. In the second detection state, the supply voltage is input from the terminals B and D, and the detection voltage is output from the terminals A and C.
It is assumed that a differential output voltage of the magnetoelectric conversion element is Vh, a gain of the differential amplifier is G, and the input offset voltage of the differential amplifier is Voa. In the first detection state, the switch S1 turns on, and the capacitor C1 is charged with Vc1=(V3−V4)=G(Vh1+Voa). Then, in the second detection state, the switch S1 turns off, and Vc2=(V3−V4)=G(−Vh2+Voa) is output. Here, V5−V6=V3−Vc1−V4=Vc2−Vc1=−G(Vh1+Vh2) is satisfied, to thereby offset the effect of the input offset voltage. Further, the detection voltages Vh1 and Vh2 of the magnetoelectric conversion element have an in-phase valid signal component and a reverse-phase element offset component, and hence the effect of the element offset component is also removed from the above-mentioned output voltage.
However, the above-mentioned magnetic sensor device according to the related art suffers from such a problem that the input offset voltage of the comparator 4 connected to a subsequent stage may not be removed, and the detected magnetic field intensity is varied.